import request from '@/utils/request'

/**
 * 评分
 * http://heartisan.online:3000/project/15/interface/api/234
 * @param {object} params
 * @param {string} params.actorId 用户id
 */
export const score = ({ actorId }) => (request({
  url: `/statistics/score/${actorId}`,
  method: 'get'
}))

/**
 * 目标完成率
 * http://heartisan.online:3000/project/15/interface/api/243
 * @param {object} params
 * @param {string} params.actorId 用户id
 */
export const mission = ({ actorId }) => (request({
  url: `/statistics/mission/${actorId}`,
  method: 'get'
}))

/**
 * 结果完成率
 * http://heartisan.online:3000/project/15/interface/api/261
 * @param {object} params
 * @param {string} params.actorId 用户id
 */
export const keyResult = ({ actorId }) => (request({
  url: `/statistics/keyResults/${actorId}`,
  method: 'get'
}))

/**
 * 团战分布数据
 * http://heartisan.online:3000/project/15/interface/api/252
 * @param {object} params
 * @param {string} params.type 用户id
 * @param {string} params.actorId 用户id
 */
export const instance = ({ type, actorId }) => (request({
  url: `/statistics/instance/${type}/${actorId}`,
  method: 'get'
}))

/**
 * 目标访问数据
 * http://heartisan.online:3000/project/15/interface/api/279
 * @param {object} params
 * @param {string} params.actorId 用户id
 */
export const viewedMission = ({ actorId }) => (request({
  url: `/statistics/viewed/mission/${actorId}`,
  method: 'get'
}))
